package Acwing.数学知识;

import java.util.Scanner;

/**
 * @Title: prime1
 * @Author 贾金博
 * @Package Acwing.数学知识
 * @Date 2025/4/10 下午10:25
 * @description: 试除法判断质数
 */
public class prime1 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        while(n -- > 0 ) {
            int x = sc.nextInt();
            if(isPrime(x)) {
                System.out.println("Yes");
            } else {
                System.out.println("No");
            }
        }
    }

    private static boolean isPrime(int x) {
        if(x <= 1) {
            return false;
        }
        for(int i = 2; i <= x / i; i ++ ) {
            if(x % i == 0) {
                return false;
            }
        }
        return true;
    }
}
